import { Category } from "@/types/content/category";
import { get, post, put, remove } from "@/utils/request";


/**
 * 获取分类列表 分页
 * @returns
 */
export const queryCategoryList = (data: Category.Query&PageParams)=>post<PageVo<Category.Row>>(`/category/pageList`,data);

/**
 * 获取所有分类
 * @returns
 */
export const queryAllCategory = () =>get<Array<Category.Row>>(`/category/allCategory`);

/**
 * 修改分类
 * @returns
 */
export const updateCategory = (data: Category.Form)=>put(`/category/update`, data);

/**
 * 新增分类
 * @returns
 */
export const addCategory = (data: Category.Form) =>post(`/category/add`,data);

/**
 * 查看分类信息
 * @returns
 */
export const checkCategoryInfo = (id: string)=>get<Category.Row>(`/category/${id}`);

/**
 * 删除分类
 * @returns
 */
export const deleteCategory = (data: IdsType) =>remove(`/category/batchRemove`,data);
